package com.redoor.app.stake.basicdata.controller;

import com.aliyun.openservices.ons.api.SendResult;
import com.redoor.app.stake.basicdata.model.BussinessTypeEnum;
import com.redoor.app.stake.basicdata.mq.sendService.impl.SendMQServiceImpl;
import com.redoornetwork.framework.core.response.ResponseResult;
import com.redoornetwork.framework.core.response.ResultGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by wangjunlei on 2018/4/18.
 */
@RestController
@RequestMapping("/base/mq")
public class MQSendController {

    @Autowired
    SendMQServiceImpl sendMQService;

    @PostMapping("/sendMessage")
    public ResponseResult sendMessage(String topic, String tag, String message,BussinessTypeEnum.MQ_BUSINESS_TYPE type) {
        SendResult result = sendMQService.sendMessage(topic,tag,message,type);
        return ResultGenerator.generatorSuccess(result);
    }
}
